﻿using System;
using System.Collections.Generic;
using System.Text;

namespace XDesigner.AppFramework.Actions
{
    public delegate void AppActionEventHandler( object sender , AppActionEventArgs args );

    public class AppActionEventArgs : EventArgs
    {
        public AppActionEventArgs(AppFrameworkClass work, AppAction action, AppActionEventStyle style)
        {
            _Framework = work;
            _Action = action;
            _Style = style;
        }

        private AppFrameworkClass _Framework = null;

        public AppFrameworkClass Framework
        {
            get
            { 
                return _Framework;
            }
            set 
            { 
                _Framework = value;
            }
        }

        private AppAction _Action = null;

        public AppAction Action
        {
            get 
            { 
                return _Action; 
            }
            set 
            { 
                _Action = value;
            }
        }

        private AppActionEventStyle _Style = AppActionEventStyle.Execute;

        public AppActionEventStyle Style
        {
            get
            { 
                return _Style;
            }
            set
            { 
                _Style = value;
            }
        }

        private object _Result = null;

        public object Result
        {
            get
            { 
                return _Result;
            }
            set
            {
                _Result = value;
            }
        }

        private bool _Cancel = false;

        public bool Cancel
        {
            get
            { 
                return _Cancel; 
            }
            set
            { 
                _Cancel = value;
            }
        }
    }

    public enum AppActionEventStyle
    {
        QueryState,
        BeforeExecute,
        Execute ,
        AfterExecute
    }
}
